#{extends 'Secure/layout.html' /}

<div id="login">
	
	<h1>&{'Hello'}</h1>
		
	#{form @authenticate(),name:"loginForm"}
		
		#{if flash.error}
			<p class="error">
				&{flash.error}
			</p>
		#{/if}
		#{if flash.success}
			<p class="success">
				&{flash.success}
			</p>
		#{/if}
	   
		<p id="username-field">
			<label for="username">&{'login'}</label>
			<input type="text" name="username" id="username" value="${flash.username}" />
		</p>
		<p id="password-field">
			<label for="password">&{'password'}</label>
			<input type="password" name="password" id="password" value="" />
		</p>
		<p id="remember-field">
			<input type="checkbox" name="remember" id="remember" value="true" ${flash.remember ? 'checked="true"' : ''} />
			<label for="remember">&{'remember'}</label>
		</p>
		<p id="signin-field">
			<input type="submit" id="signin" value="&{'signin'}" />
		</p>
	#{/form}
	<script language="JavaScript" type="text/javascript"  xml:space="preserve" >
  // //This function performs validation of form fields(Use of the 'gen_validatorv4' library function frmvalidator.addValidation)
  // //more information -http://www.javascript-coder.com/html-form/javascript-form-validation.phtml
  // var frmvalidator  = new Validator("loginForm");
  // frmvalidator.addValidation("username","req","&{'validate.noMail'}");//validate username exist
  // frmvalidator.addValidation("username","maxlen=50"); //validate maximum 50 number of symbol in email
  // frmvalidator.addValidation("username","email");  //validate correct email
  // frmvalidator.addValidation("password","minlen=6","&{'validate.wrongPass'}"); //validate minimum 6 number of symbol in password
  
  
  </script>
	
 
 
</div>